package com.lhy;

public class Test62 {
    //调用此方法比出最大值
    public static <T extends Comparable<T>> T maximum(T x,T y,T z){
     T max = x;
     if (y.compareTo(max)>0){
         max = y;
     }
     if (z.compareTo(max)> 0){
         max = z;
     }
     return max;
    }
    public static void main(String[] args) {
        System.out.printf("%d,%d和%d中的最大值为：%d\n ",3,4,5,maximum(3,4,5));
        System.out.printf("%.1f,%.1f和%.1f中的最大值为：%.1f\n ",3.3,4.4,5.5,maximum(3.3,4.4,5.5));
        System.out.printf("%s,%s和%s中的最大值为：%s\n ","三","四","五",maximum("三","四","五"));
    }
}
